﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using BaseData.Common;
using BaseData.UI;
using TaxData.SysConfig;
using TaxEntity.SysConfig;
using TaxEntity.User;

namespace TaxBiz.SysConfig
{
    /// <summary>
    /// 街道逻辑层
    /// </summary>
    public class JiedaoBiz
    {
        private JiedaoData jdd = new JiedaoData();

        /// <summary>
        /// 获取街道信息实体
        /// </summary>
        public JiedaoEntity GetEntityById(int ID)
        {
            JiedaoEntity model = jdd.GetEntityById(ID);
            return model;
        }

        /// <summary>
        /// 删除街道
        /// </summary>
        public bool Delete(int ID, UserEntity optUser)
        {
            bool isSucc = jdd.Delete(ID);
            return isSucc;
        }

        /// <summary>
        /// 获取街道列表
        /// </summary>
        public DataTable GetList(string strWhere, int pageSize, int page, ref int allCount)
        {
            DataTable dt = jdd.GetList(strWhere, pageSize, page, ref allCount);
            return dt;
        }

        /// <summary>
        /// 获取街道列表
        /// </summary>
        public DataTable GetList(int xiangzhenID)
        {
            DataTable dt = jdd.GetList(xiangzhenID);
            return dt;
        }

        /// <summary>
        /// 增加街道
        /// </summary>
        /// <param name="model">街道信息实体</param>
        /// <param name="optUser">操作人</param>
        /// <returns>成功街道编号,失败返回0</returns>
        public int Add(JiedaoEntity model, UserEntity optUser)
        {
            int id = jdd.Add(model);
            return id;
        }

        /// <summary>
        /// 修改街道信息
        /// </summary>
        /// <param name="model">修改街道</param>
        /// <param name="optUser">操作人</param>
        /// <returns>操作结果</returns>
        public bool Update(JiedaoEntity model, UserEntity optUser)
        {
            bool isSucc = jdd.Update(model);
            return isSucc;
        }
    }
}